<html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" >  

    <!--    <h:body>-->
    <ui:composition template="layout.xhtml">
        <ui:define name="corpo">
            <h:form id="index_form" acceptcharset="utf-8"> 
                <div id="breadcrumb">
                    <p:commandLink  actionListener="#{managerIndex.redirect('index.xhtml')}" value="Inicio" update="@form" immediate="true"/> >
                    <p:commandLink  actionListener="#{managerIndex.redirect('config.xhtml')}" value="Configurações" update="@form" immediate="true"/> >
                    <p:commandLink  value="Estoque Selo" update="@form" immediate="true"/>
                </div>
                <p:panel header="Estoque">
                    <h:panelGrid columns="2" width="900" style="text-align: center">
                        <p:row>
                            <p:poll interval="15" listener="#{managerEstoque.seloEstoque()}" update="grafic" />
                            <p:barChart id="grafic" value="#{managerEstoque.graEstoque}"  breakOnNull="true" style="width:400px;height:350px;" legendPosition="ne"  title="SELOS EM ESTOQUE" min="0" max="#{managerEstoque.qtd}" seriesColors="C53535,  2288AA, cc6666, 004B84, 222222, A7F477, FF2900" />  
                        </p:row>
                        <p:barChart  value="#{managerEstoque.graSaida}"  breakOnNull="true" style="width:400px;height:350px;" legendPosition="ne"  title="SELOS USADOS" min="0" max="#{managerEstoque.qtd1}" seriesColors="C53535,  2288AA, cc6666, 004B84, 222222, A7F477, FF2900" />  
                    </h:panelGrid>
                    <br/>
                    <p:lineChart value="#{managerEstoque.graSaidaMes}"  
                                 legendPosition="e" title="Selos Usados por mês" 
                                 minY="0" maxY="#{managerEstoque.qtdSairam}" xaxisLabel="Meses do Ano"
                                 yaxisLabel="Quantidade de Selo" style="width:850px;height:400px;" />
                    <p:poll interval="15" listener="#{managerEstoque.seloCancelados()}" update="graCancel" />
                    <br/>
                    
                    <p:barChart  id="graCancel" value="#{managerEstoque.graCancelado}" 
                                 breakOnNull="true" style="width:400px;height:350px;" 
                                 legendPosition="ne"  title="SELOS CANCELADOS" min="0"
                                 max="#{managerEstoque.qtdCancel gt 10 ? managerEstoque.qtdCancel :  10}"
                                 seriesColors="C53535,  2288AA, cc6666, 004B84, 222222, A7F477, FF2900" />  
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
